import request from '@/utils/request'

const api = {
  apipath: '/kqgl'
}

// 自动打卡
export function zddk (params) {
  return request({
    url: api.apipath + '/hcKqgl/save',
    method: 'get',
    params: params
  })
}

// 根据月份查询出打卡记录
export function getList (params) {
  return request({
    url: api.apipath + '/hcKqgl/month',
    method: 'get',
    params: params
  })
}

// 修改
export function edit (params) {
  return request({
    url: api.apipath + '/hcKqgl/modify',
    method: 'get',
    params: params
  })
}

// 导出考勤管理表
export function exportKqgl (params) {
  return request({
    url: api.apipath + '/admin/export',
    method: 'get',
    params: params,
    responseType: 'blob'
  })
}

// 下班打卡
export function typeClock (parameter) {
  return request({
    url: api.apipath + '/hcKqgl/insert',
    method: 'post',
    data: parameter
  })
}

// 获取当天打卡记录
export function getDayDetail () {
  return request({
    url: api.apipath + '/hcKqgl/day',
    method: 'get'
  })
}

// 季度考勤统计接口
export function getKqtjJd (params) {
  return request({
    url: api.apipath + '/hcKqgl/season',
    method: 'get',
    params: params
  })
}

// 年度考勤统计接口
export function getKqtjNd (params) {
  return request({
    url: api.apipath + '/hcKqgl/year',
    method: 'get',
    params: params
  })
}